import { ref } from 'vue'
import type PageContent from '@/components/page-content/page-content.vue'

// type fetchPageData()=>void
// setup中相同的逻辑的抽取
function useConentPage() {
  const userDataShowRef = ref<InstanceType<typeof PageContent>>()
  function searchClick(formData: any) {
    // console.log(formData)
    userDataShowRef.value?.fetchPageData(formData)
  }
  function resetClick() {
    userDataShowRef.value?.fetchPageData()
  }

  return {
    userDataShowRef,
    resetClick,
    searchClick
  }
}

export default useConentPage
